package org.linlinjava.litemall.db.dao.marketing_manage;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.vo.marketing_manager.*;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * @author houzb
 * @Description
 * @create 2021-08-28 17:40
 */
@Mapper
public interface MarketingDeductionMapper {

    /**
     * 获取抵扣金规则列表
     *
     * @param params
     * @return
     */
    public List<MarketingDeductionRuleInfo> deductionList(Map<String, Object> params);

    /**
     * 获取抵扣金规则的数量
     *
     * @param params
     * @return
     */
    public int count(Map<String, Object> params);

    /**
     * 获取总共发放和消耗的抵扣金总数信息
     *
     * @param params
     * @return
     */
    public List<DeductionTypeAmountData> getDisAndUseStaticDeductionAmount(Map<String, Object> params);

    /**
     * 获取用户所拥有的抵扣金的金额信息
     *
     * @param params
     * @return
     */
    public double getUserHasTotalDeductionAmount(Map<String, Object> params);

    List<DeductionListBackDto> getRuleList(@Param("type") Integer type, @Param("state") Integer state, @Param("name") String name,
                                           @Param("shopId") Integer shopId);

    List<DeductionUserListDto> selectDeductionUserList(@Param("shopId") Integer shopId, @Param("id") Integer id, @Param("type") Integer type,
                                                       @Param("phone") String phone, @Param("storeId") Integer storeId,
                                                       @Param("goodsId") Integer goodsId, @Param("startTime") LocalDateTime startTime,
                                                       @Param("endTime") LocalDateTime endTime);

    List<DeductionOrderListDto> selectDeductionOrderList(@Param("userId") Integer userId, @Param("shopId") Integer shopId, @Param("id") Integer id, @Param("type") Integer type,
                                                         @Param("orderSn") String orderSn,
                                                         @Param("goodsId") Integer goodsId, @Param("startTime") LocalDateTime startTime,
                                                         @Param("endTime") LocalDateTime endTime);


}
